<?php
// bootstrap_doctrine.php

// See :doc:`Configuration <../reference/configuration>` for up to date autoloading details.
use Doctrine\ORM\Tools\Setup;
FileLoader::getInstance()->loadFile(C_FW_fwPackage . 'libraries/Doctrine/Common/ClassLoader.php');

$doctrineClassLoader = new \Doctrine\Common\ClassLoader('Doctrine', C_FW_fwPackage . 'libraries');
$doctrineClassLoader->register();

$entitiesClassLoader = new \Doctrine\Common\ClassLoader('models', C_FW_customPackage);
$entitiesClassLoader->register();

$proxiesClassLoader = new \Doctrine\Common\ClassLoader('Proxies', C_FW_customPackage . 'models');
$proxiesClassLoader->register();

$symfonyClassLoader = new \Doctrine\Common\ClassLoader('Symfony', C_FW_fwPackage . 'libraries/Doctrine');
$symfonyClassLoader->register();

// Create a simple "default" Doctrine ORM configuration for XML Mapping
$isDevMode = true;
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
// or if you prefer yaml or annotations
$config = Setup::createAnnotationMetadataConfiguration(array( C_FW_customPackage . 'models'), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
$config->setProxyDir( C_FW_customPackage . 'models/proxies');
$config->setProxyNamespace('test_claycode\Proxies');
// database configuration parameters
$conn = array(
    'driver' => 'pdo_mysql',
   	'user' =>'root',
	'password' => '',
	'host' => 'localhost',
	'dbname' => 'test_claycode'
);

// obtaining the entity manager
$entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);




